namespace panda {
  /**
   * 封装Timer计时器类
   */
  export type TimerCallback = (id:number, data:any)=>void;
  export class Timer {
    public id:number = -1;  // 计时器id
    public enabled:boolean = false; // 标记当前计时器是否有效
    public callback:TimerCallback;
    public callbackData:any = undefined;
    public countdown:number = 0; // 倒计时器，每次update时会倒计时
    public timeout:number = 0;
    public onlyOnce:boolean = false;

    constructor(callback:TimerCallback) {
      this.callback = callback;
    }
  }
}